package com.starleague.battletech.unit.jpa.appengine;

import java.util.Map;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;

import com.starleague.battletech.unit.IMutablePilot;
import com.starleague.jpa.appengine.GaeDao;

@Entity(name = "PILOT")
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
public class PilotGae
        extends GaeDao
        implements IMutablePilot
{
    @Basic(optional = false)
    @Column(nullable = false)
    private int pilotingSkill;

    public PilotGae(int pilotingSkill)
    {
        this.pilotingSkill = pilotingSkill;
    }

    protected PilotGae()
    {
        //
    }

    @Override
    public int getPilotingSkill()
    {
        return this.pilotingSkill;
    }

    @Override
    public void setPilotingSkill(int pilotingSkill)
    {
        this.pilotingSkill = pilotingSkill;
    }

    @Override
    public Map<String, Object> infoProperties()
    {
        Map<String, Object> infoPropertyMap = super.infoProperties();
        infoPropertyMap.put("pilotingSkill", this.pilotingSkill);
        return infoPropertyMap;
    }
}
